str = "hello world"
dic = {}

for item in str:
    if item in dic: 
    	dic[item] += 1
    else:
    	dic[item] = 1

print dic